package com.xin.di.uav.applet.shop.controller;

import com.xin.di.uav.applet.resp.CommodityResponse;
import com.xin.di.uav.applet.shop.service.IShoppingService;
import com.xin.di.uav.common.utils.Rs;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author LTQ
 * @since 2023-12-07
 */
@RestController
@RequestMapping("/sys/commodity/")
public class CommodityController {

    @Autowired
    private IShoppingService iShoppingService;

    @GetMapping("get-by-business-id")
    @Operation(tags = "通过商家id获取商品列表", description = "通过商家id获取商品列表")
    public Rs<List<CommodityResponse>> getByBusinessId(@RequestParam String businessId) {
        return Rs.success(iShoppingService.getByBusinessId(businessId));
    }
}
